package single.shop.search.junit.common;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import single.shop.search.model.bean.BrandDO;
import single.shop.search.service.BrandService;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:/shop-search-root-bean-test.xml")
public class SearchControllerTestCase extends AbstractJUnit4SpringContextTests{

    @Resource
    BrandService brandSearchService;
	private final static Log LOG = LogFactory.getLog(SearchControllerTestCase.class);

	public SearchControllerTestCase() {
	}

	@Test
	public void testServiceCase() throws Exception {
	    LOG.info("Hello World!");
	    BrandDO b = new BrandDO();
	    b.setId(1);
	    b.setName("neamd");
	    brandSearchService.updateBrandById(b);
	    BrandDO dos = brandSearchService.getBrandDoById(1);
	    LOG.info(dos.toString());
	}

	
	
}
